﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using FO.Models;
using FOSystem.CultureHelper;
namespace FO.Controllers
{
    public class LayoutHelperController : CultureController
    {
        //
        // GET: /LayoutHelper/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult LanguageZone()
        {
            Bussiness.Language.LanguageBLL langbll;
            langbll = new Bussiness.Language.LanguageBLL();
            var langs = langbll.getActiveLang();
            return PartialView(langs);
        }
        public ActionResult LanguageZoneCpanel()
        {
            Bussiness.Language.LanguageBLL langbll;
            langbll = new Bussiness.Language.LanguageBLL();
            var langs = langbll.getActiveLang();
            return PartialView(langs);
        }
        public ActionResult ReadContentFolder()
        {
            string serverPath = Server.MapPath("~/Content");
            DirectoryInfo d = new DirectoryInfo(serverPath);
            List<SpeFolder> listf = new List<SpeFolder>();
            foreach (DirectoryInfo ff in d.GetDirectories())
            {
                SpeFolder a = new SpeFolder();
                a.FullName = ff.FullName;
                a.Name = ff.Name;
                if (ff.GetFiles().Count() > 0 || ff.GetDirectories().Count() > 0)
                    a.hasFiles = true;
                listf.Add(a);
            }
            return PartialView(listf);
        }
    }
}
